home *** CD-ROM | disk | FTP | other *** search
- Path: cscsun3.larc.nasa.gov!hook
- From: hook@cscsun3.larc.nasa.gov (Ed Hook)
- Newsgroups: comp.lang.c
- Subject: Re: HELP: Illegal Pointer Arithmetic
- Date: 27 Feb 1996 20:27:36 GMT
- Organization: CSC/NASA Langley Research Center
- Distribution: world
- Message-ID: <4gvpfo$lht@reznor.larc.nasa.gov>
- References: <4gj0ug$730@news.one.net> <danpop.825121139@rscernix> <31306a18.309961701@nntp.ix.netcom.com> <4gq77b$bmo@reznor.larc.nasa.gov> <4gqija$bmo@reznor.larc.nasa.gov> <31331425.52605482@nntp.ix.netcom.com>
- Reply-To: hook@cscsun3.larc.nasa.gov
- NNTP-Posting-Host: cscsun3.larc.nasa.gov
-
- In article <31331425.52605482@nntp.ix.netcom.com>, miker3@ix.netcom.com (Mike Rubenstein) writes:
-
- [ much stuff deleted -- the unfortunate detritus of two (count 'em -- two)
- posts in which I publicly made a fool of myself commenting on Schildt's
- code: ]
- |>
- |> > |> |>
- |> > |> |> do {
- |> > |> |> ch = fgetc(fp);
- |> > |> |> /* ... */
- |> > |> |> } while (!feof(fp));
- |> > |> |>
- |>
- |> Actually, it fails on every input file since it goes through the loop
- |> after reaching EOF. An empty file is just one example. On a one
- |> character file it goes through the loop twice, once with the character
- |> and once with EOF.
- |>
- |> Unless, of course, the unshown code includes a test for ch == EOF, but
- |> that would be contrary to the concept of an example. feof() returns
- |> nonzero only after end of file has been reached.
- |>
- Hopefully, this is my year's quota of egregious stupidity ...
-
- Thanks to the comp.lang.c community, which forbore to flame me
- mercilessly.
-
- |>
- |> Michael M Rubenstein
-
- --
- Ed Hook | Coppula eam, se non posit
- Computer Sciences Corporation | acceptera jocularum.
- NASA Langley Research Center | Me? Speak for my employer?...<*snort*>
- Internet: hook@cscsun3.larc.nasa.gov | ... Get a _clue_ !!! ...
-